package ig.metrica.modelos.entity;

import javax.ejb.*;

/**
 * This is the bean class for the ModeloorigenesdatosBean enterprise bean.
 * Created 18/04/2006 02:10:34 PM
 * @author jsanchez
 */
public abstract class ModeloorigenesdatosBean implements EntityBean, ModeloorigenesdatosLocalBusiness {
    private EntityContext context;
    
    // <editor-fold defaultstate="collapsed" desc="EJB infrastructure methods. Click on the + sign on the left to edit the code.">
    // TODO Consider creating Transfer Object to encapsulate data
    // TODO Review finder methods
    /**
     * @see javax.ejb.EntityBean#setEntityContext(javax.ejb.EntityContext)
     */
    public void setEntityContext(EntityContext aContext) {
        context = aContext;
    }
    
    /**
     * @see javax.ejb.EntityBean#ejbActivate()
     */
    public void ejbActivate() {
        
    }
    
    /**
     * @see javax.ejb.EntityBean#ejbPassivate()
     */
    public void ejbPassivate() {
        
    }
    
    /**
     * @see javax.ejb.EntityBean#ejbRemove()
     */
    public void ejbRemove() {
        
    }
    
    /**
     * @see javax.ejb.EntityBean#unsetEntityContext()
     */
    public void unsetEntityContext() {
        context = null;
    }
    
    /**
     * @see javax.ejb.EntityBean#ejbLoad()
     */
    public void ejbLoad() {
        
    }
    
    /**
     * @see javax.ejb.EntityBean#ejbStore()
     */
    public void ejbStore() {
        
    }
    // </editor-fold>
    
    
    public abstract Integer getModelo();
    public abstract void setModelo(Integer modelo);
    
    public abstract Integer getOrigenesdatos();
    public abstract void setOrigenesdatos(Integer origenesdatos);
    
    
    public ModeloorigenesdatosPK ejbCreate(Integer modelo, Integer origenesdatos)  throws CreateException {
        if (modelo == null) {
            throw new CreateException("The field \"modelo\" must not be null");
        }
        if (origenesdatos == null) {
            throw new CreateException("The field \"origenesdatos\" must not be null");
        }
        
        // TODO add additional validation code, throw CreateException if data is not valid
        setModelo(modelo);
        setOrigenesdatos(origenesdatos);
        
        return null;
    }
    
    public void ejbPostCreate(Integer modelo, Integer origenesdatos) {
        // TODO populate relationships here if appropriate
        
    }
}
